<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddViewCountToUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            //
            $table->bigInteger('view_count')->unsigned()->index()->default(0)->comment('访问量');
            $table->bigInteger('blog_rank')->unsigned()->index()->default(0)->comment('博客排行榜');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            //
            $table->dropColumn('view_count');
            $table->dropColumn('blog_rank');
        });
    }
}
